package ext;

import image.ImageGroup;
import image.ps.PixelShader;
import math.vec2i;
import math.vec3;

public class PSInvert extends PixelShader
{
    
    public int mTargetI3;
    
    
    public PSInvert()
    {
        super();
        this.mTargetI3 = -1;
    }
    
    
    public PixelShader copy()
    {
        PSInvert copy = new PSInvert();
        copy.mTargetI3 = this.mTargetI3;
        return copy;
    }
    
    
    public void shade(
            ImageGroup aTarget, 
            vec2i aImagePixel, 
            vec2i aImageSize)
    {
        vec3 datum = aTarget.image3(this.mTargetI3).read(aImagePixel);
        datum.set(vec3.sub(1.0, datum));
    }
    
}
